Transmission Control Protocol (TCP) allows applications on networked computers to generate connections to each other. Over these connections, the applications are then able to exchange data packets. Many applications such as the world wide web and email utilize TCP. TCP is reliable and guarantees in-order delivery of data.
Applications send streams of 8-bit bytes to TCP to be delivered through the network. TCP divides the byte stream into appropriately sized segments and then passes the resulting packets to the Internet Protocol (IP) for delivery through the network to a TCP module of a target computer on the network. TCP ensures that no packets are lost by assigning a sequence number to each packet. This sequence number also ensures the packets are delivered in the correct order. The TCP module of the target computer sends back an acknowledgment for packets which have been successfully received. If an acknowledgment is not received within a reasonable amount of time, a timeout is triggered on the transmitting computer. Then, the data packet is re-sent.
As briefly described above, a 3-way handshake is implemented to establish a TCP connection. The transmitting computer first sends a synchronization packet to initiate the connection. Then the target computer sends an acknowledgment packet back. Finally, the transmitting computer sends an acknowledgment back to the target. By utilizing a 3-way handshake, computers are able to verify their connection.
The concern with TCP is that hackers are able to utilize this 3-way handshake to locate future victims to be hacked. Using scanning software, a set of packets are sent out across the network. Any clients on the network will respond to these packets. Then, hackers are able to determine which computers are accessible on the network and which ports are open on those computers. Using that information, a hacker is able to abuse the computer by crashing it or performing other malicious activity with it such as stealing data.
User Datagram Protocol (UDP) is a connectionless protocol that allows applications on networked computers to send short messages known as datagrams to each other. Unlike TCP, UDP does not provide guaranteed reliability. Datagrams are able to arrive disordered or get lost without notice. The reason for this is that UDP does not utilize the 3-way handshake of TCP where a target computer acknowledges that it is present when an unknown transmitting computer sends an initiating connection. However, as mentioned above, UDP has a number of drawbacks including being unreliable, not ordered, and other issues that make UDP insufficient for a specified purpose.